package com.xd.hbsys.ps;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xd.hbsys.aqi.AQIService;

import java.util.List;

@RestController
public class PSController {

    @Autowired
    private PSService psService;

    @RequestMapping(value = "/psquery")
    public String psquery(
            @RequestParam(value = "type", required = false) String type,
            @RequestParam(value = "code", required = false) String code) {

        if (type.equals("all")) {
            return psService.queryallps();
        } else if (type.equals("detail") && code != null) {
            return psService.queryps(code);
        }
        return "";
    }


}
